/**
 * Created by ptt on 2016/9/01/12:24.
 */
define(["../maintools/Controller.js", "../../gis/gis/loadMap.js"], function (Controller, map) {
	var data = $("#temp").html();$("#thematicMap").html(data);
	/*data start*/
	var tempLayer; 
	var result = {
		//条件
		condition:{
			content:["区域选择","年度选择","季度选择","月份选择"],
			"区域选择":{
				content:Pengtu.buildCodes("2050"),
				showContition:[],
			},
			"年度选择":{
				content:[{label:"2011",value:"2011"},{label:"2012",value:"2012"},{label:"2013",value:"2013"},{label:"2014",value:"2014"},{label:"2015",value:"2015"},{label:"2016",value:"2016"}],
				showContition:[],
			},
			"季度选择":{
				content:[{label:"一季度",value:"一季度"},{label:"二季度",value:"二季度"},{label:"三季度",value:"三季度"},{label:"四季度",value:"四季度"}],
				showContition:["dailyMaintenance"],
			},
			"月份选择":{
				content:[{label:"一月",value:"1"},{label:"二月",value:"2"},{label:"三月",value:"3"},{label:"四月",value:"4"},{label:"五月",value:"5"},{label:"六月",value:"6"},{label:"七月",value:"7"},{label:"八月",value:"8"},{label:"九月",value:"9"},{label:"十月",value:"10"},{label:"十一月",value:"11"},{label:"十二月",value:"12"}],
				showContition:["dailyMaintenance"],
			}
		},
		//分类
		calssType:{
			//专题图
			subjectMap:{
				planProject:{
					content:["规划成果"],
					subitem: {
						content: ["规划分布"],
						"规划分布": {
							projectType: Pengtu.buildCodes("2045"),
							dataType:"WFS",
							dataConfig:queryConfig.queryProject,
							typeValue:"planproject",
							styleConfig:"/ssjc/pl/planpreparepoj!getPLByFG.action?filter_EQS_facilityGrade=1"
						}
					},
				},
				buildProject:{
					content:["建设项目"],
					subitem:{
						content:["前期项目","在建项目"],
						"前期项目":{
							projectType:Pengtu.buildCodes("2045"),
							dataType:"WFS",
							dataConfig:queryConfig.queryProject,
							typeValue:"earlierproject",
							styleConfig:"/ssjc/pre/preparepoj!findPPByFG.action"
						},
						"在建项目":{
							projectType:Pengtu.buildCodes("2045"),
							dataType:"WFS",
							dataConfig:queryConfig.queryProject,
							typeValue:"constructproject",
							styleConfig:"/ssjc/mp/project!findPPByFG.action"
						}
					},
				},
				roadNetwork:{
					content:["道路基础路网"],
					subitem:{
						content:["道路","桥梁"],
						"道路":{
							content:["城市道路","公路"],
							"城市道路":{
								projectType:Pengtu.buildCodes("2008"),
							},
							"公路":{
								projectType:Pengtu.buildCodes("2009"),
							},
							dataType:"WFS",
							dataConfig:queryConfig.queryRoad,
							typeValue:""
						},
						"桥梁":{
							projectType:Pengtu.buildCodes("2021"),
						}
					}
				},
				roadCondition: {
					content:["路况检测"],
					subitem: {
						content:["市政道路","公路"],
						"市政道路": {
							content:["道路类型","评价指标"],
							"道路类型":{
								projectType: Pengtu.buildCodes("2008")
							},
							"评价指标":{
								projectType:[{label:"PQI",value:"PQI"},{label:"RQI",value:"RQI"},{label:"PCI",value:"PCI"},
								             {label:"FQI",value:"FQI"},{label:"FCI",value:"FCI"},{label:"RZ",value:"RZ"},
								             {label:"CL",value:"CL"},{label:"PL",value:"PL"},{label:"SDL",value:"SDL"},
								             {label:"QL",value:"QL"}]
							},
							dataType:"WFST",
							dataConfig:queryConfig.queryRoad,
							typeValue:"市政道路",
							roadType:"102",
							styleConfig:"/ssjc/lj/detectioninfo!gisGradeJson.action?"
						},
						"公路": {
							content:["道路类型","评价指标"],
							"道路类型":{
								projectType: Pengtu.buildCodes("2009"),
							},
							"评价指标":{
								projectType:[{label:"MQI",value:"MQI"},{label:"PCI",value:"PCI"},{label:"RQI",value:"RQI"},
								             {label:"SCI",value:"SCI"},{label:"PQI",value:"PQI"},{label:"TCI",value:"TCI"}]
							},
							dataType:"WFST",
							dataConfig:queryConfig.queryRoad,
							typeValue:"公路",
							roadType:"101",
							styleConfig:"/ssjc/lj/detectioninfo!gisGradeJson.action?"
						},

					}
				},
				dailyMaintenance:{
					content:["日常养护"],
					subitem: {
						content:[],
						projectType: [
							//{label:"养护区域分布",value:"养护区域分布"},
							{label:"巡查轨迹",value:"巡查轨迹"},
							{label:"病害分布",value:"病害分布"},
							{label:"保养分布",value:"保养分布"},
							{label:"小修项目分布",value:"小修项目分布"},
							{label:"三危地图",value:"三危地图"}
						],
						"养护区域分布":{
							dataType:"WMS",
							dataConfig:queryConfig.queryBiaoDuan,
						},
						"巡查轨迹":{
							dataType:"geojson",
							dataConfig:{
								url:"/ssjc/rep/tracking!provideGeoJson.action?",
								style:"/ssjc/images/gis/path.png",
								hoveStyle:"/ssjc/images/gis/path-red.png",
								detailUrl:"/ssjc/rep/tracking!provideGeoJsonLine.action?userId="
							},
						},
						"病害分布":{
							dataType:"geojson",
							dataConfig:{
								url:"/ssjc/rep/damagedisease!provideGeoJson.action?",
								style:"/ssjc/images/gis/disease.png",
								hoveStyle:"/ssjc/images/gis/disease-red.png",
								detailUrl:appConfig.repairAddress+"/inspection/damagedisease!getDetail.action?caseNo="
							},
						},
						"保养分布":{
							dataType:"geojson",
							dataConfig:{
								url:"/ssjc/rep/roadfit!provideGeoJson.action?",
								style:"/ssjc/images/gis/maintain.png",
								hoveStyle:"/ssjc/images/gis/maintain-red.png",
								detailUrl:appConfig.repairAddress+"/fit/roadfit!info.action?id="
							},
						},
						"小修项目分布":{
							dataType:"geojson",
							dataConfig:{
								url:"/ssjc/rep/roadrepair!provideGeoJson.action?",
								style:"/ssjc/images/gis/minorrepair.png",
								hoveStyle:"/ssjc/images/gis/minorrepair-red.png",
								sbUrl:appConfig.repairAddress+"/rep/roadrepairapply!input.action?hd=0&type=1&num=0&roadRepairID=",
								ysUrl:appConfig.repairAddress+"/rep/roadrepairaccept!getRepairAccept.action?flag=1&num=1&roadRepairID="
							},
						},
						"三危地图":{
							dataType:"geojson",
							dataConfig:{
								url:"/ssjc/em/facilitykey!provideGeoJson.action?",
								style:"/ssjc/images/gis/sanwei.png",
								hoveStyle:"/ssjc/images/gis/sanwei-red.png",
								detailUrl:"/ssjc/em/view/facilitykey!view.action?id="
							},
						}
					}
				},
				dzxProject:{
					content:["大中修"],
					subitem: {
						content:["在建项目分布"],
						"在建项目分布": {
							projectType: [{label:"大修",value:"大修"},{label:"中修",value:"中修"}]
						},
						"大修":{
							dataType:"geojson",
							dataConfig:{
								url:"",
								style:"/ssjc/images/gis/marker-ghduzd.png",
								hoveStyle:"/ssjc/images/gis/marker.png"
							},
						},
						"中修":{
							dataType:"geojson",
							dataConfig:{
								url:"",
								style:"/ssjc/images/gis/marker-ghduzd.png",
								hoveStyle:"/ssjc/images/gis/marker.png"
							},
						}
					}
				}
			},
			//统计图
			staticMap:{
				roadNetworkStatic:{
					content:["道路基础路网"],
					subitem: {
						content: ["市政道路统计", "公路统计", "路网密度统计", "桥梁"],
						"市政道路统计": {
							projectType: [{label:"道路长度",value:"道路长度"},{label:"道路面积",value:"道路面积"},{label:"道路数量",value:"道路数量"}],
							dataconfig:{
								url:"/ssjc/taglib/roadbasicinfo!showAllDistrict.action?",
							},
							valueType:"102",
							colors:['#E54912','#DD7C6A','#497B36','#42BABC','#F4BE29'],
							showToolTip:true,
							showLegend:true,
						},
						"公路统计": {
							projectType: [{label:"道路长度",value:"道路长度"},{label:"道路面积",value:"道路面积"},{label:"道路数量",value:"道路数量"}],
							dataconfig:{
								url:"/ssjc/taglib/roadbasicinfo!showAllDistrict.action?",
							},
							valueType:"101",
							colors:['#E54912','#DD7C6A','#497B36','#42BABC','#F4BE29'],
							showToolTip:true,
							showLegend:true,
						},
						"路网密度统计": {
							projectType: [{label:"路网密度",value:"路网密度"}],
							dataconfig:{
								url:"/ssjc/dl/roadbasicinfo!getRoadNetworkJson.action?",
							},
							colors:['#82c247','#3471b0'],
							showToolTip:false,
							showLegend:false,
						},
						"桥梁": {
							projectType: [{label:"桥梁统计",value:"桥梁统计"}],
							dataconfig:{
								url:"/ssjc/taglib/bridgebasicinfo!gisCountJson.action",
							},
							colors: ['#E54912','#DD7C6A','#497B36','#42BABC','#F4BE29','#BCBE48','#B5DBBA','#ABB7D0','#8595CA','#D7A2C6','#00000'],
							showToolTip:true,
							showLegend:true,
						}
					}
				},
				roadConditionStatic:{
					content:["路况监测"],
					subitem: {
						content: ["市政道路评价指标", "公路评价指标"],
						"市政道路评价指标": {
							projectType: [{label:"PQI",value:"PQI"},{label:"RQI",value:"RQI"},{label:"PCI",value:"PCI"},
								             {label:"FQI",value:"FQI"},{label:"FCI",value:"FCI"},{label:"RZ",value:"RZ"},
								             {label:"CL",value:"CL"},{label:"PL",value:"PL"},{label:"SDL",value:"SDL"},
								             {label:"QL",value:"QL"}],
							dataconfig:{
								url:"/ssjc/lj/detectioninfo!gisCountJson.action?year=2015",
							},
							colors: ['#336699','#ff6666'],
							showToolTip:false,
							showLegend:false,
							valueType:"102",
						},
						"公路评价指标": {
							projectType: [{label:"MQI",value:"MQI"},{label:"PCI",value:"PCI"},{label:"RQI",value:"RQI"},
								             {label:"SCI",value:"SCI"},{label:"PQI",value:"PQI"},{label:"TCI",value:"TCI"}],
							dataconfig:{
								url:"/ssjc/lj/detectioninfo!gisCountJson.action?year=2015",
							},
							colors:['#336699','#ff6666'],
							showToolTip:false,
							showLegend:false,
							valueType:"101",
						}
					}
				},
				dailyMaintenanceStatic:{
					content:["日常养护"],
					subitem: {
						content: ["养护统计"],
						"养护统计":{
							projectType:[{label:"验收率",value:"验收率"},{label:"巡查达标率",value:"巡查达标率"},{label:"主动发现率",value:"主动发现率"}],
							dataconfig:{
								url:"/ssjc/statistic/statistic!getSData.action?",
							},
							colors: ['#336699','#ff6666'],
							showToolTip:false,
							showLegend:false,
						}
					}
				}
			},
		}
	};
	var selectedRegion=[]; //选择的区域
	var selectedYear; //选择的年份
	var selectedquarter=[];//选择的季度
	var selectedMonth;//选择的月份
	var selectedMapType; //选择的地图类型
	var selectedProjectedType;//选择的项目类型
	var selectedSubitemType;
	var selectSubitems=[];//选择的分类
	var selectedszRoadtype=[]; //选择的道路类型
	var selectedglRoadtype=[];//公路
	var selectedStaticType;//统计类型
	/*end data*/

	//initial
	Controller = Controller.Controller;
	map = map.map;
	var thematic = Controller.create({
		elements: {},
		events: {
			"click .top":"choice",
			"click .titleSelect p":"titleSelect",
			"click .region li":"regionSelect",
			"click .year .rgt li":"yearSelect",
			"click .quarter .rgt li":"quarterSelect",
			"click .month .rgt li":"monthSelect",
			"click .thematicMap .box .title":"thematicMapToggle",
			"click .statisticalMap .box .title":"statisticalMapToggle",
			"click .bar .tab":"tabSelect",
			"click .box .cont ul li":"subNode",
		},
		//顶级栏目
		choice:function(){
			$(".popup_close").hide();
			$(".search_popup").hide();
			$(".container li").removeClass("hover");
			$(".container li i").removeClass("hover");
			$(".projectBranch li").removeClass("hover");
			$(".projectBranch li i").removeClass("hover");
			$(".content").hide();
			$(".projectBranch .screen").hide();
			$(".informationCentre .packet").html("");
			$(".informationCentre .paging").hide();
			$("#informationCentre").css("height","auto");
			var code = $("#thematicMap .top .png");
			var has = code.hasClass("on");
			if(has){
				$(".titleSelect").css("height","0px");
				code.removeClass("on");has = code.hasClass("on");
			}else{
				$(".titleSelect").css("height","60px");
				code.addClass("on");has = code.hasClass("on");
			}
		},
		//地图类型选择
		titleSelect:function(e){
			var val = e.currentTarget.dataset.val;
			var code = e.currentTarget.dataset.code;
			var value=e.currentTarget.dataset.value;
			$(".top span").html(val);
			$(".titleSelect").css("height","0px");
			$("#thematicMap .top .png").removeClass("on");
			$(".region").html(" ");
			$(".year .rgt").html(" ");
			$(".quarter .rgt").html(" ");
			$(".month .rgt").html(" ");
			switch (code){
				case "thematicMap":
					$(".region").show();
					$(".time").show();
					$(".time .year").show();
					$(".timeSelection").show();
					$(".regionSelection").show();
					$(".thematicMap").show();$(".statisticalMap").hide();
					$(".statisticalMap .box").find(".cont").slideUp(300);
					$(".statisticalMap .box").find(".title").find(".png").removeClass("on");
					$(".top").attr("data-style","thematicMap");
					$(".statisticalMap .box .title").removeClass("on");
					//初始化专题地图
					$(".box .planProject ul").html(" ");$(".box .buildProject ul").html(" ");$(".box .roadNetwork ul").html(" ");
					$(".box .roadCondition ul").html(" ");$(".box .dailyMaintenance ul").html(" ");$(".box .dzxProject ul").html(" ");
					for(var key in result.calssType.subjectMap) {
						var projecttype=result.calssType.subjectMap[key];//专题图的内容
						var subitems=projecttype.subitem;//每个层的内容
						var subitemContent=subitems.content;//tab数目
						if(subitemContent.length>0) {
							for (var t = 0; t < subitemContent.length; t++) {
								if(subitems[subitemContent[t]].projectType) {
									var subitemProjectType = subitems[subitemContent[t]].projectType;
									for (var i = 0; i < subitemProjectType.length; i++) {
										if(t==0){
											$(".box ."+ key+" ul").append('<li data-MapType="subjectMap" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'">' + subitemProjectType[i].label + '</li>');
										}
									}
								}
								else
								{
									for(var roadType in subitems[subitemContent[t]].content) {
										var roadTypeValue = subitems[subitemContent[t]].content[roadType];
										if (typeof(roadTypeValue)=="string") {
											for (var j = 0; j < subitems[subitemContent[t]][roadTypeValue].projectType.length; j++) {
												if (t == 0) {
													if (roadType == 0) {
														$(".box ." + key + " ul.tp").append('<li data-MapType="subjectMap" data-sub="subTp" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'">' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
													} else if (roadType == 1) {
														$(".box ." + key + " ul.btm").append('<li data-MapType="subjectMap" data-sub="subBtm" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'">' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
													}
												}
											}
										}
									}
								}
							}
						}
						else {
							for (var i = 0; i < subitems.projectType.length; i++) {
								$(".box ."+ key+" ul").append('<li data-MapType="subjectMap" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+ subitems.projectType[i].value+'">' +  subitems.projectType[i].label + '</li>');
							}
						}
						$(".box ."+key+" ul").append('<div style="clear:both;"></div>');
					}
					break;
				case "statisticalMap":
					$(".region").slideUp(300);
					$(".time").slideUp(300);
					$(".time .year").slideUp(300);
					$(".timeSelection").slideUp(300);
					$(".regionSelection").slideUp(300);
					$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".statisticalMap").show();$(".thematicMap").hide();
					$(".thematicMap .box").find(".cont").slideUp(300);
					$(".thematicMap .box").find(".title").find(".png").removeClass("on");
					$(".top").attr("data-style","statisticalMap");
					$(".thematicMap .box .title").removeClass("on");
					//初始化专题统计图
					$(".box .tp").html(" ");$(".box .tpCont").html(" ");
					$(".box .btmCont").html(" ");$(".box .btm").html(" ");
					for(var key in result.calssType.staticMap) {
						var projecttype=result.calssType.staticMap[key];//专题统计图的内容
						var subitems=projecttype.subitem;//每个层的内容
						var subitemContent=subitems.content;//tab数目
						if(subitemContent.length>0) {
							for (var t = 0; t < subitemContent.length; t++) {
								if(subitems[subitemContent[t]].projectType) {
									var subitemProjectType = subitems[subitemContent[t]].projectType;
									for (var i = 0; i < subitemProjectType.length; i++) {
										if(t==0){
											$(".box ."+ key+" ul.tp").append('<li data-MapType="staticMap" data-sub="subTp" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'" >' + subitemProjectType[i].label + '</li>');
										}else if(t==1){
											$(".box ."+ key+" ul.tpCont").append('<li data-MapType="staticMap" data-sub="subTpCont" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'" >' + subitemProjectType[i].label + '</li>');
										}else if(t==2){
											$(".box ."+ key+" ul.btmCont").append('<li data-MapType="staticMap" data-sub="subBtmCont" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'" >' + subitemProjectType[i].label + '</li>');
										}else if(t==3){
											$(".box ."+ key+" ul.btm").append('<li data-MapType="staticMap" data-sub="subBtm" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'" >' + subitemProjectType[i].label + '</li>');
										}
									}
								}
							}
						}
						$(".box ."+key+" ul").append('<div style="clear:both;"></div>');
					}
					break;
			}

			//区域
			$(".region").append('<li data-inde="all" >全部</li>');
			for(var i=0;i<result.condition.区域选择.content.length;i++){
				j = i+1;
				$(".region").append('<li data-inde="'+j+'" data-value="'+result.condition.区域选择.content[i].value+'" >'+result.condition.区域选择.content[i].label+'</li>');
			}
			$(".region").append('<div style="clear:both;"></div>');
			//年度
			for(var i=0;i<result.condition.年度选择.content.length;i++){
				$(".year .rgt").append('<li data-inde="'+i+'" data-value="'+result.condition.年度选择.content[i].value+'">'+result.condition.年度选择.content[i].label+'</li>');
			}
			$(".year .rgt").append('<div style="clear:both;"></div>');
			//季度
			for(var i=0;i<result.condition.季度选择.content.length;i++){
				$(".quarter .rgt").append('<li data-inde="'+i+'" data-value="'+result.condition.季度选择.content[i].value+'">'+result.condition.季度选择.content[i].label+'</li>');
			}
			$(".quarter .rgt").append('<div style="clear:both;"></div>');
			//月份
			for(var i=0;i<result.condition.月份选择.content.length;i++){
				$(".month .rgt").append('<li data-inde="'+i+'" data-value="'+result.condition.月份选择.content[i].value+'">'+result.condition.月份选择.content[i].label+'</li>');
			}
			$(".month .rgt").append('<div style="clear:both;"></div>');
			$(".region li").eq(0).css("font-weight","bold");
			var ha = $(".thematicMap .box .road").hasClass("on");
			if(ha){$(".time .year").hide();$(".timeSelection").hide();}
			//记录选择的地图类型
			selectedMapType=value;
			//置空选择项
		     selectedProjectedType="";//选择的项目类型
			 selectedSubitemType="";
			 selectSubitems=[];//选择的分类
			 selectedszRoadtype=[]; //选择的道路类型
			 selectedglRoadtype=[];//公路
			selectedRegion=[];
			m_reMoveLayerAndolay();
			tempLayer&&map.removeLayer(tempLayer);
			Message_bone.trigger("legendHide");
		},
		//区域选择
		regionSelect:function(e){
			var inde = e.currentTarget.dataset.inde;
			var value= e.currentTarget.getAttribute("data-value");
			var compare = 'all';
			var has = $(".region li").eq(inde).hasClass("on");
			var leng = $(".region li").length-1;
			var length = $(".region li.on").length;
			if(has){
				$(".region li").eq(inde).removeClass("on");has = $(".region li").eq(inde).hasClass("on");
				selectedRegion.RemoveValue(value);
			}else{
				$(".region li").eq(inde).addClass("on");has = $(".region li").eq(inde).hasClass("on");

				selectedRegion.push(value);
			}
			if(inde==compare){
				//选择全部区域
				selectedRegion=[];
				if(length!=leng){
					$(".region li").eq(0).siblings().addClass("on");
					for(var i=0;i<result.condition.区域选择.content.length;i++){
						selectedRegion.push(result.condition.区域选择.content[i].value);
					}
				}else{
					$(".region li").eq(0).siblings().removeClass("on");
				}
			}
			addMapData();
		},
		//年度选择
		yearSelect:function(e){
			var inde = e.currentTarget.dataset.inde;
			var value= e.currentTarget.getAttribute("data-value");
			var has = $(".year .rgt li").eq(inde).hasClass("on");
			if(has){
				$(".year .rgt li").eq(inde).removeClass("on");
			}else{
				$(".year .rgt li").eq(inde).addClass("on").siblings().removeClass("on");
			}
			selectedYear=value;
			addMapData();
		},
		//季度选择
		quarterSelect:function(e){
			var inde = e.currentTarget.dataset.inde;
			var value= e.currentTarget.getAttribute("data-value");
			var has = $(".quarter .rgt li").eq(inde).hasClass("on");
			if(has){
				$(".quarter .rgt li").eq(inde).removeClass("on");
				selectedquarter.push(value);
			}else{
				$(".quarter .rgt li").eq(inde).addClass("on").siblings().removeClass("on");
				selectedquarter.RemoveValue(value);
			}
			addMapData();
		},
		//月份选择
		monthSelect:function(e){
			var inde = e.currentTarget.dataset.inde;
			var value= e.currentTarget.getAttribute("data-value");
			var has = $(".month .rgt li").eq(inde).hasClass("on");
			if(has){
				$(".month .rgt li").eq(inde).removeClass("on");
				selectedMonth=null;

			}else{
				$(".month .rgt li").eq(inde).addClass("on").siblings().removeClass("on");
				selectedMonth=value;
			}
			addMapData();
		},
		//第二级选择事件
		tabSelect:function(e){
			var index = e.currentTarget.dataset.index;
			var style = e.currentTarget.dataset.style;
			var val = e.currentTarget.innerText;
			switch (style){
				case "build":
					$(".box .buildProject .bar .tab").eq(index).addClass("on").siblings().removeClass("on");
					$(".box .buildProject ul").html(" ");
					for(var key in result.calssType.subjectMap) {
						var projecttype=result.calssType.subjectMap[key];
						var subitems=projecttype.subitem;
						var subitemContent=subitems.content;
						if(subitemContent.length>0) {
							for (var t = 0; t < subitemContent.length; t++) {
								if(subitems[subitemContent[t]].projectType) {
									var subitemProjectType = subitems[subitemContent[t]].projectType;
									if(subitemContent[index]==val){
										for (var i = 0; i < subitemProjectType.length; i++) {
											if(t==index)$(".box ."+ key+" ul").append('<li data-MapType="subjectMap" data-inde="'+i+'" data-projectType="' + key + '" data-value="'+subitemProjectType[i].value+'" >' + subitemProjectType[i].label + '</li>');
										}
									}
								}
							}
						}
						$(".box ."+key+" ul").append('<div style="clear:both;"></div>');	
					}
					break;
				case "road":
					$(".box .roadNetwork .bar .tab").eq(index).addClass("on").siblings().removeClass("on");
					$(".box .roadNetwork ul").html(" ");
					//*********************************************//
					if(index==0){
						$(".box .roadNetwork .subTp").show();$(".box .roadNetwork .tp").show();
						$(".box .roadNetwork .subBtm").html("公路");
						$(".box .roadNetwork .subBtm").css({"color":"#404040","font-weight":"bold","height":"auto","line-height":"normal","text-align":"left"});
					}else if(index==1){
						$(".box .roadNetwork .subTp").hide();$(".box .roadNetwork .tp").hide();
						$(".box .roadNetwork .subBtm").html("暂无数据！");
						$(".box .roadNetwork .subBtm").css({"color":"#E39A01","font-weight":"normal","height":"50px","line-height":"50px","text-align":"center"});
					}
					for(var key in result.calssType.subjectMap) {
						var projecttype=result.calssType.subjectMap[key];
						var subitems=projecttype.subitem;
						var subitemContent=subitems.content;
						if(subitemContent.length>0) {
							for (var t = 0; t < subitemContent.length; t++) {
								if(!subitems[subitemContent[t]].projectType) {
									for(var roadType in subitems[subitemContent[t]].content){
										var roadTypeValue=subitems[subitemContent[t]].content[roadType];
										if(subitemContent[index]==val) {
											if (typeof(roadTypeValue) == "string") {
												for (var j = 0; j < subitems[subitemContent[t]][roadTypeValue].projectType.length; j++) {
													if (t == index) {
														if (roadType == 0) {
															$(".box ." + key + " ul.tp").append('<li data-MapType="subjectMap" data-sub="subTp" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'">' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
														} else if (roadType == 1) {
															$(".box ." + key + " ul.btm").append('<li data-MapType="subjectMap" data-sub="subBtm" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'" >' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
														}
													}
												}
											}
										}
									}
								}
							}
						}
						$(".box ."+key+" ul").append('<div style="clear:both;"></div>');
					}
					break;
				case "traffic":
					$(".box .roadCondition .bar .tab").eq(index).addClass("on").siblings().removeClass("on");
					$(".box .roadCondition ul").html(" ");
					for(var key in result.calssType.subjectMap) {
						var projecttype=result.calssType.subjectMap[key];
						var subitems=projecttype.subitem;
						var subitemContent=subitems.content;
						if(subitemContent.length>0) {
							for (var t = 0; t < subitemContent.length; t++) {
								if(!subitems[subitemContent[t]].projectType) {
									for(var roadType in subitems[subitemContent[t]].content){
										var roadTypeValue=subitems[subitemContent[t]].content[roadType];
										if(subitemContent[index]==val) {
											if (typeof(roadTypeValue) == "string") {
												for (var j = 0; j < subitems[subitemContent[t]][roadTypeValue].projectType.length; j++) {
													if (t == index) {
														if (roadType == 0) {
															$(".box ." + key + " ul.tp").append('<li data-MapType="subjectMap" data-sub="subTp" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'">' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
														} else if (roadType == 1) {
															$(".box ." + key + " ul.btm").append('<li data-MapType="subjectMap" data-sub="subBtm" data-inde="' + j + '" data-projectType="' + key + '" data-value="'+subitems[subitemContent[t]][roadTypeValue].projectType[j].value+'" >' + subitems[subitemContent[t]][roadTypeValue].projectType[j].label + '</li>');
														}
													}
												}
											}
										}
									}
								}
							}
						}
						$(".box ."+key+" ul").append('<div style="clear:both;"></div>');
					}
					break;
				default:;
			}
			selectedSubitemType=val;
			selectSubitems=[];//选择的分类
			selectedszRoadtype=[]; //选择的道路类型
			selectedglRoadtype=[];//公路
			m_reMoveLayerAndolay();
			Message_bone.trigger("legendHide");
		},
		//第一级选择事件
		thematicMapToggle:function(e){
			var code = e.currentTarget.dataset.code;
			var style = e.currentTarget.dataset.style;
			var value=e.currentTarget.dataset.value;
			$(".box .cont ul li").removeClass("on");
			var tt = $(".thematicMap .box").eq(code).find(".title").find(".png");
			var has = tt.hasClass("on");
			$(".thematicMap .box .title").eq(code).addClass("on").parent().siblings().find(".title").removeClass("on");
			if(!has){
				tt.addClass("on").parent().parent().siblings().find(".title").find(".png").removeClass("on");
			}else{tt.removeClass("on");$(".thematicMap .box .title").eq(code).removeClass("on");}
			$(".thematicMap .box").eq(code).find(".cont").slideToggle(300).parent().siblings().find(".cont").slideUp(300);
			
			tempLayer&&map.removeLayer(tempLayer);
			switch (style){
				case "plan":
					$(".timeSelection").slideDown(300);
					$(".time .year").slideDown(300);
					//$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".time .quarter .rgt li").removeClass("on");$(".time .month .rgt li").removeClass("on");
					selectedSubitemType="规划分布";
					break;
				case "build":
					$(".timeSelection").slideDown(300);
					$(".time .year").slideDown(300);
					//$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".two .bar .tab").eq(0).addClass("on").siblings().removeClass("on");
					$(".time .quarter .rgt li").removeClass("on");$(".time .month .rgt li").removeClass("on");
					selectedSubitemType="前期项目";
					break;
				case "road"://*********************//
					$(".timeSelection").slideUp(300);
					$(".time .year").slideUp(300);
					//$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".box .three .subheads").show();$(".box .three .sz").show();
					$(".three .bar .tab").eq(0).addClass("on").siblings().removeClass("on");
					$(".time .quarter .rgt li").removeClass("on");$(".time .month .rgt li").removeClass("on");
					selectedSubitemType="道路";
					break;
				case "traffic":
					$(".timeSelection").slideDown(300);
					$(".time .year").slideDown(300);
					//$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".four .bar .tab").eq(0).addClass("on").siblings().removeClass("on");
					$(".time .quarter .rgt li").removeClass("on");$(".time .month .rgt li").removeClass("on");
					selectedSubitemType="市政道路";
					break;
				case "curing":
					$(".timeSelection").slideDown(300);
					$(".time .year").slideDown(300);
					//$(".time .quarter").slideToggle(300);
					$(".time .month").slideToggle(300);
					selectedSubitemType=null;
					GetBdMap();
					break;
				case "repair":
					$(".timeSelection").slideDown(300);
					$(".time .year").slideDown(300);
					//$(".time .quarter").slideUp(300);
					$(".time .month").slideUp(300);
					$(".time .quarter .rgt li").removeClass("on");$(".time .month .rgt li").removeClass("on");
					selectedSubitemType="大修";
					GetBdMap();
					break;
				default:;
			}
			selectedProjectedType=value;
			selectSubitems=[];//选择的分类
			selectedszRoadtype=[]; //选择的道路类型
			selectedglRoadtype=[];//公路
			m_reMoveLayerAndolay();
			Message_bone.trigger("legendHide");
		},
		//专题统计图第一级点击事件
		statisticalMapToggle:function(e){
			var code = e.currentTarget.dataset.code;
			var style = e.currentTarget.dataset.style;
			var value=e.currentTarget.dataset.value;
			$(".box .cont ul li").removeClass("on");
			var tt = $(".statisticalMap .box").eq(code).find(".title").find(".png");
			var has = tt.hasClass("on");
			$(".statisticalMap .box .title").eq(code).addClass("on").parent().siblings().find(".title").removeClass("on");
			if(!has){
				tt.addClass("on").parent().parent().siblings().find(".title").find(".png").removeClass("on");
			}else{tt.removeClass("on");$(".statisticalMap .box .title").eq(code).removeClass("on");}
			$(".statisticalMap .box").eq(code).find(".cont").slideToggle(300).parent().siblings().find(".cont").slideUp(300);
			switch (style){
				case "grid":

					break;
				case "traffic":

					break;
				case "curing":

					break;
				default:;
			}
			selectedProjectedType=value;
		},
		//第三级选择事件
		subNode:function(e){
			var inde = e.currentTarget.dataset.inde;
			var num = e.currentTarget.dataset.projecttype;
			var sub = e.currentTarget.dataset.sub;
			var maptype =e.currentTarget.dataset.maptype;
			var value=e.currentTarget.dataset.value;
			var has = null;
			switch (num){
				/*专题图*/
				case "planProject":
					has = $(".box .planProject ul li").eq(inde).hasClass("on");
					if(has){
						$(".box .planProject ul li").eq(inde).removeClass("on");has = $(".box .planProject ul li").eq(inde).hasClass("on");
						selectSubitems.RemoveValue(value);
					}else{
						$(".box .planProject ul li").eq(inde).addClass("on");has = $(".box .planProject ul li").eq(inde).hasClass("on");
						selectSubitems.push(value);
					}
					break;
				case "buildProject":
					has = $(".box .buildProject ul li").eq(inde).hasClass("on");
					if(has){
						$(".box .buildProject ul li").eq(inde).removeClass("on");has = $(".box .buildProject ul li").eq(inde).hasClass("on");
						selectSubitems.RemoveValue(value);
					}else{
						$(".box .buildProject ul li").eq(inde).addClass("on");has = $(".box .buildProject ul li").eq(inde).hasClass("on");
						selectSubitems.push(value);
					}
					break;
				case "roadNetwork":
					switch (sub){
						case "subTp":
							has = $(".box .roadNetwork .tp li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetwork .tp li").eq(inde).removeClass("on");has = $(".box .roadNetwork .tp li").eq(inde).hasClass("on");
								selectedszRoadtype.RemoveValue(value);
							}else{
								$(".box .roadNetwork .tp li").eq(inde).addClass("on");has = $(".box .roadNetwork .tp li").eq(inde).hasClass("on");
								selectedszRoadtype.push(value);
							}
							$(".box .roadNetwork .btm li").removeClass("on");
							selectedglRoadtype=[];
							break;
						case "subBtm":
							has = $(".box .roadNetwork .btm li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetwork .btm li").eq(inde).removeClass("on");has = $(".box .roadNetwork .btm li").eq(inde).hasClass("on");
								selectedglRoadtype.RemoveValue(value);
							}else{
								$(".box .roadNetwork .btm li").eq(inde).addClass("on");has = $(".box .roadNetwork .btm li").eq(inde).hasClass("on");
								selectedglRoadtype.push(value);
							}
							$(".box .roadNetwork .tp li").removeClass("on");
							selectedszRoadtype=[];
							break;
					}
					break;
				case "roadCondition":
					switch (sub){
						case "subTp":
							has = $(".box .roadCondition .tp li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadCondition .tp li").eq(inde).removeClass("on");has = $(".box .roadCondition .tp li").eq(inde).hasClass("on");
								selectedglRoadtype.RemoveValue(value);
							}else{
								$(".box .roadCondition .tp li").eq(inde).addClass("on");has = $(".box .roadCondition .tp li").eq(inde).hasClass("on");
								selectedglRoadtype.push(value);
							}
							break;
						case "subBtm":
							has = $(".box .roadCondition .btm li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadCondition .btm li").eq(inde).removeClass("on");has = $(".box .roadCondition .btm li").eq(inde).hasClass("on");
								selectSubitems.RemoveValue(value);
							}else{
								$(".box .roadCondition .btm li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadCondition .btm li").eq(inde).hasClass("on");
								selectSubitems.push(value);
							}
							break;
					}
					break;
				case "dailyMaintenance":
					has = $(".box .dailyMaintenance ul li").eq(inde).hasClass("on");
					if(has){
						$(".box .dailyMaintenance ul li").eq(inde).removeClass("on");has = $(".box .dailyMaintenance ul li").eq(inde).hasClass("on");
						selectedSubitemType=null;
					}else{
						$(".box .dailyMaintenance ul li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .dailyMaintenance ul li").eq(inde).hasClass("on");
						selectedSubitemType=value;
					}

					break;
				case "dzxProject":
					has = $(".box .dzxProject ul li").eq(inde).hasClass("on");
					if(has){
						$(".box .dzxProject ul li").eq(inde).removeClass("on");has = $(".box .dzxProject ul li").eq(inde).hasClass("on");
					}else{
						$(".box .dzxProject ul li").eq(inde).addClass("on");has = $(".box .dzxProject ul li").eq(inde).hasClass("on");
					}
					break;
				/*专题统计图*/
				case "roadNetworkStatic":
					switch (sub){
						case "subTp"://市政道路统计
							has = $(".box .roadNetworkStatic .tp li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetworkStatic .tp li").eq(inde).removeClass("on");has = $(".box .roadNetworkStatic .tp li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadNetworkStatic .tp li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadNetworkStatic .tp li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadNetworkStatic .tpCont li").removeClass("on");$(".box .roadNetworkStatic .btmCont li").removeClass("on");
							$(".box .roadNetworkStatic .btm li").removeClass("on");
							selectedStaticType="市政道路统计";
							break;
						case "subTpCont": //公路统计
							has = $(".box .roadNetworkStatic .tpCont li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetworkStatic .tpCont li").eq(inde).removeClass("on");has = $(".box .roadNetworkStatic .tpCont li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadNetworkStatic .tpCont li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadNetworkStatic .tpCont li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadNetworkStatic .tp li").removeClass("on");$(".box .roadNetworkStatic .btmCont li").removeClass("on");
							$(".box .roadNetworkStatic .btm li").removeClass("on");
							selectedStaticType="公路统计";
							break;
						case "subBtmCont"://路网密度统计
							has = $(".box .roadNetworkStatic .btmCont li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetworkStatic .btmCont li").eq(inde).removeClass("on");has = $(".box .roadNetworkStatic .btmCont li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadNetworkStatic .btmCont li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadNetworkStatic .btmCont li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadNetworkStatic .tp li").removeClass("on");$(".box .roadNetworkStatic .tpCont li").removeClass("on");
							$(".box .roadNetworkStatic .btm li").removeClass("on");
							selectedStaticType="路网密度统计";
							break;
						case "subBtm"://桥梁统计
							has = $(".box .roadNetworkStatic .btm li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadNetworkStatic .btm li").eq(inde).removeClass("on");has = $(".box .roadNetworkStatic .btm li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadNetworkStatic .btm li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadNetworkStatic .btm li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadNetworkStatic .tp li").removeClass("on");$(".box .roadNetworkStatic .tpCont li").removeClass("on");
							$(".box .roadNetworkStatic .btmCont li").removeClass("on");
							selectedStaticType="桥梁";
							break;
					}
					break;
				case "roadConditionStatic":
					switch (sub){
						case "subTp":
							has = $(".box .roadConditionStatic .tp li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadConditionStatic .tp li").eq(inde).removeClass("on");has = $(".box .roadConditionStatic .tp li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadConditionStatic .tp li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadConditionStatic .tp li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadConditionStatic .tpCont li").removeClass("on");
							selectedStaticType="市政道路评价指标";
							break;
						case "subTpCont":
							has = $(".box .roadConditionStatic .tpCont li").eq(inde).hasClass("on");
							if(has){
								$(".box .roadConditionStatic .tpCont li").eq(inde).removeClass("on");has = $(".box .roadConditionStatic .tpCont li").eq(inde).hasClass("on");
								selectedSubitemType=null;
							}else{
								$(".box .roadConditionStatic .tpCont li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .roadConditionStatic .tpCont li").eq(inde).hasClass("on");
								selectedSubitemType=value;
							}
							$(".box .roadConditionStatic .tp li").removeClass("on");
							selectedStaticType="公路评价指标";
							break;
					}
					break;
				case "dailyMaintenanceStatic":
					has = $(".box .dailyMaintenanceStatic .tp li").eq(inde).hasClass("on");
					if(has){
						$(".box .dailyMaintenanceStatic .tp li").eq(inde).removeClass("on");has = $(".box .dailyMaintenanceStatic .tp li").eq(inde).hasClass("on");
						selectedSubitemType=null;
					}else{
						$(".box .dailyMaintenanceStatic .tp li").eq(inde).addClass("on").siblings().removeClass("on");has = $(".box .dailyMaintenanceStatic .tp li").eq(inde).hasClass("on");
						selectedSubitemType=value;
					}
					selectedStaticType="养护统计";
					break;
				default:;
			}
			addMapData();
		},
		template: "#temp",
	});
	//高亮符号
	var hightimage = new ol.style.Icon({
		src: "/ssjc/images/gis/label-hong.png",
		scale: 0.8
	});
	var hightLightStyles = {
		'Point': new ol.style.Style({
			image: hightimage
		}),
		'LineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#00FFFF',
				width: 4
			})
		}),
		'MultiLineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#00FFFF',
				width: 4
			})
		}),
		'Polygon': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#00FFFF',
				lineDash: [4],
				width: 4
			}),
			fill: new ol.style.Fill({
				color: 'rgba(0, 0, 255, 0.1)'
			})
		})
	};
	var HightLightstyleFunction = function(feature) {
		return hightLightStyles[feature.getGeometry().getType()];
	};
	//基础符号
	var image = new ol.style.Icon({
		src: "/ssjc/images/gis/label-lan.png",
		scale: 0.8
	});
	var styles = {
		'Point': new ol.style.Style({
			image: image
		}),
		'LineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#CD00CD',
				width: 4
			})
		}),
		'MultiLineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#CD00CD',
				width: 4
			})
		}),
		'Polygon': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'blue',
				lineDash: [4],
				width: 4
			}),
			fill: new ol.style.Fill({
				color: 'rgba(0, 0, 255, 0.1)'
			})
		})
	};
	//重点项目符号
	var majorimage = new ol.style.Icon({
		src: "/ssjc/images/gis/label.png",
		scale: 0.8
	});
	var majorstyles = {
		'Point': new ol.style.Style({
			image: majorimage
		}),
		'LineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'red',
				width: 4
			})
		}),
		'MultiLineString': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'red',
				width: 4
			})
		}),
		'Polygon': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'red',
				lineDash: [4],
				width: 4
			}),
			fill: new ol.style.Fill({
				color: 'rgba(0, 0, 255, 0.1)'
			})
		})
	};
	//重点项目IDS
	var majorProjectIds;

	var styleFunction = function(feature) {
			if(!majorProjectIds)
			{
				return styles[feature.getGeometry().getType()];
			}
		else {
				if(feature.getKeys().indexOf("projectid")>=0){
						var fetaureprojectid=feature.getProperties()["projectid"];
					if(majorProjectIds.indexOf(fetaureprojectid)>=0)
					{
						return majorstyles[feature.getGeometry().getType()];
					}
					else return styles[feature.getGeometry().getType()];
				}
				else{
					return styles[feature.getGeometry().getType()];
				}
			}

	};


	//路况符号
	var evaluationStyles={
		'green': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'green',
				width: 3
			})
		}),
		'blue':new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'blue',
				width: 3
			})
		}),
		'yellow': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'yellow',
				width: 3
			})
		}),
		'red': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: 'red',
				width: 3
			})
		})
	};
	var evaluationdata;
	var evaluationStyleFun=function(featrue){
		if(evaluationdata)
		{
			var roadecode=featrue.getProperties().hb_code;
			var featureRoadLevel="green";
			for(var i=0;i<evaluationdata.length;i++){
				if(roadecode==evaluationdata[i]["roadCode"])
				{
					featureRoadLevel=evaluationdata[i]["grade"];
					featrue.set("data-score",evaluationdata[i]["score"]);
					break;
				}
			}
			return evaluationStyles[featureRoadLevel];
		}
	};
	//路网符号
	var wfsStyles = {
		'111': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#0764c4',
				width: 4
			})
		}),
		'212':new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#006634',
				width: 4
			})
		}),
		'414': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#ff5474',
				width: 4
			})
		}),
		'313': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#15c4c6',
				width: 4
			})
		}),
		'515': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#5c2a69',
				width: 4
			})
		}),
		'121': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#b799bb',
				width: 4
			})
		}),
		'222': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#c40080',
				width: 4
			})
		}),
		'323': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#d49188',
				width: 4
			})
		}),
		'424': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#097894',
				width: 4
			})
		}),
		'525': new ol.style.Style({
			stroke: new ol.style.Stroke({
				color: '#e8410c',
				width: 4
			})
		}),
	};
	//路网符号
	var WfsstyleFunction = function(feature) {
		return wfsStyles[feature.getProperties().class];
	};
	//添加专题图
	function  addMapData(){
		m_reMoveLayerAndolay();
		Message_bone.trigger("legendHide");
		var mapTypeData=result.calssType[selectedMapType];//地图类型数据
		if(!mapTypeData) return;
		if(!selectedSubitemType) return;
		if(!selectedProjectedType) return;
		var  projectData=mapTypeData[selectedProjectedType];
		var subitemData=projectData.subitem[selectedSubitemType];
		var mapStyleFunciont;
		switch (selectedMapType)
		{
			case"subjectMap":
				switch (selectedProjectedType){
					case"planProject":
					case"buildProject":
						if(selectedRegion.length>0&&selectedYear&&selectSubitems.length>0) {
							GetWFSData(subitemData);
						}
						mapStyleFunciont=styleFunction;
						break;
					case"roadNetwork":
						if(selectedszRoadtype.length>0||selectedglRoadtype.length>0) {
							getRoadWFS(subitemData);
						}
						mapStyleFunciont=WfsstyleFunction;
						break;
					case"roadCondition":
						if(selectedglRoadtype.length>0&&selectSubitems.length>0&&selectedYear) {
							GetroadCondition(subitemData);
						}
						mapStyleFunciont=evaluationStyleFun;
						break;
					case "dailyMaintenance":
						if(subitemData&&selectedYear&&selectedMonth) {
							AddGeojsonToMap(subitemData);
						}
						mapStyleFunciont=styleFunction;
						break;
				}
				var selectPointerMove = new ol.interaction.Select({
					condition: ol.events.condition.pointerMove
				});
				map.addInteraction(selectPointerMove);
				var pre;
				selectPointerMove.on("select", function(e) {
					var hit = !!e.target.getFeatures().getLength();
					map.getTargetElement().style.cursor = hit ? 'pointer' : 'default';
					if (hit) {
						pre && pre.setStyle(mapStyleFunciont(pre));
						pre = e.target.getFeatures().array_[0];
						pre.setStyle(HightLightstyleFunction(pre));
					} else {
						if(pre&&mapStyleFunciont) {
							pre.setStyle(mapStyleFunciont(pre));
						}
					}
				});
				map.on('click', queryFun);
				break;
			case"staticMap":
				subitemData=projectData.subitem[selectedStaticType];
				AddStaticMap(subitemData);
				break;
		}
	};
	//添加GeoJSon到地图上
	function  AddGeojsonToMap(projectData){
		if(selectedRegion.length==0&selectedMonth&&!selectedYear) return;
		var tempRegion;
		for(var i=0;i<selectedRegion.length;i++)
		{
			if(i==0){
				tempRegion=selectedRegion[i];
			}else{tempRegion=tempRegion+","+selectedRegion[i];}
		}
		var vectorSource = new ol.source.Vector();
		var value = data.value;
		var url=projectData.dataConfig.url+"district="+tempRegion+"&month="+selectedMonth+"&year="+selectedYear;
		$.get(url).
		then(function(response) {
			var format = new ol.format.GeoJSON();
			var features;
			features = format.readFeatures(response, {featureProjection: 'EPSG:3857'});
			vectorSource.addFeatures(features);
		    var layer = new ol.layer.Vector({
				source: vectorSource,
				style: styleFunction
			});
			layer.set("layerName","geoJsonLayer");
			m_TempLayer = layer;
			map.addLayer(layer);
			var selectClick = new ol.interaction.Select({
				condition: ol.events.condition.click
			});
			map.addInteraction(selectClick);
			selectClick.on("select", function (e) {
				if (!e.target.getFeatures().getLength()) return $("#overlay").data("query").setPosition([9999, 9999]);
				var overlay = new ol.Overlay({
					element: document.getElementById("overlay"),
					positioning: "bottom-center"
				});
				map.addOverlay(overlay);
				var element = overlay.getElement();
				$(element).addClass("detail");
				$(element).find(".ohead p").html(e.target.getFeatures().array_[0].values_.landmark);
				$(element).find(".ocontent").empty();
				var property = e.target.getFeatures().array_[0].getProperties();
				for (var key in property) {
					if (typeof property[key] === "string" && key !== "landmark" && key !== "id"&&key!="userId"&&key!="projectId")
						$("<p>").text(Pengtu.buildCodeName("7777", key)+ ": " + Pengtu.buildCodeName("7778", property[key])).appendTo($(element).find(".ocontent"));
				}
				if(selectedSubitemType=="小修项目分布"){
						$("<p>").text("申报表:").append($("<a>").text("查看申报表").attr({
							"href": projectData.dataConfig.sbUrl + property["id"],
							"target": "_blank"
						})).appendTo($(element).find(".ocontent"));
						$("<p>").text("  验收表:").append($("<a>").text("查看验收表").attr({
							"href": projectData.dataConfig.ysUrl + property["id"],
							"target": "_blank"
						})).appendTo($(element).find(".ocontent"));
						$(element).data("query", overlay);
				}
				else if(property.id) {
					$("<p>").text("详细信息:").append($("<a>").text("查看详情").attr({
						"href": projectData.dataConfig.detailUrl + property["id"],
						"target": "_blank"
					})).appendTo($(element).find(".ocontent"));
					$(element).data("query", overlay);
				}
				else if(property.projectId){
					$("<p>").text("详细信息:").append($("<a>").text("查看详情").attr({
						"href": projectData.dataConfig.detailUrl + property["projectId"],
						"target": "_blank"
					})).appendTo($(element).find(".ocontent"));
					$(element).data("query", overlay);
				}
				$(element).data("query", overlay);
				overlay.setPosition(e.mapBrowserEvent.coordinate);
				var pixel = e.mapBrowserEvent.pixel;
				var maxWidth = $("#mapContain").prop("clientWidth") - 200;
				if (pixel[0] < 200 || pixel[0] > maxWidth || pixel[1] < 200) {
					var coordinate;
					var pan = new ol.animation.pan({
						duration: 800,
						easing: ol.easing.easeOut,
						source: map.getView().getCenter()
					});
					map.beforeRender(pan);
					if (pixel[0] > maxWidth) {
						coordinate = map.getCoordinateFromPixel([$("#mapContain").prop("clientWidth") / 2 + 200, pixel[1]]);
						map.getView().setCenter(coordinate);
					} else if (pixel[0] < 200) {
						coordinate = map.getCoordinateFromPixel([$("#mapContain").prop("clientWidth") / 2 - 200, pixel[1]]);
						map.getView().setCenter(coordinate);
					} else if (pixel[1] < 200){
						coordinate = map.getCoordinateFromPixel([pixel[0], $("#mapContain").prop("clientHeight") / 2 - 200]);
						map.getView().setCenter(coordinate);
					} else {
						map.getView().setCenter(e.mapBrowserEvent.coordinate);
					}
				}
			});
			Message_bone.trigger("infoEnd");
			Message_bone.trigger("loaded");
		});
		Message_bone.trigger("infoStart");
		Message_bone.trigger("loading");
	};
	//加载路网数据
	function getRoadWFS(projectData){
		queryData=projectData.dataConfig
		var f = ol.format.ogc.filter;
		var featureRequest = new ol.format.WFS().writeGetFeature({
			srsName: 'EPSG:4326',
			featureNS: queryData.featureNS,
			featurePrefix: queryData.featurePrefix,
			featureTypes: queryData.layers,
			outputFormat: 'application/json',
			filter:GetRoadContial(projectData.typeValue)
		});
		fetch(queryData.url, {
			method: 'POST',
			body: new XMLSerializer().serializeToString(featureRequest)
		}).then(function(response) {
			return response.json();
		}).then(function(json) {
			var features = new ol.format.GeoJSON().readFeatures(json,{dataProjection: "EPSG:4326", featureProjection: "EPSG:3857"});
			if (features.length > 0) {
				var detailSource = new ol.source.Vector();
				var detailLayer = new ol.layer.Vector({
					source: detailSource,
					style: WfsstyleFunction
				});
				detailSource.addFeatures(features);
				//结果定位
				if(features.length>0){
					map.getView().fit(detailSource.getExtent(),map.getSize(),{padding: [170, 50, 30, 150]});
				}
				detailLayer.set("layerName","roadLayer");
				m_TempLayer = detailLayer;
				map.addLayer(detailLayer);
			}
		});
		//添加图例
		//加载符号
		var	lagendRenderdata=[];
		lagendRenderdata.push({
			color: '#0764c4',
			text: "城市快速路"
		});
		lagendRenderdata.push({
			color: '#006634',
			text: "主干道"
		});
		lagendRenderdata.push({
			color: '#15c4c6',
			text: "次干道"
		});
		lagendRenderdata.push({
			color: '#ff5474',
			text: "支路"
		});
		lagendRenderdata.push({
			color: '#5c2a69',
			text: "街坊路"
		});
		lagendRenderdata.push({
			color: '#b799bb',
			text: "高速公路"
		});
		lagendRenderdata.push({
			color: '#c40080',
			text: "一级公路"
		});
		lagendRenderdata.push({
			color: '#d49188',
			text: "二级公路"
		});
		lagendRenderdata.push({
			color: '#097894',
			text: "三级公路"
		});
		lagendRenderdata.push({
			color: '#e8410c',
			text: "四级公路"
		});

		Message_bone.trigger("legendShow", [lagendRenderdata]);

	}
    //加载项目地图位置
	function GetWFSData(projectData){
		queryData=projectData.dataConfig
		if(!projectData.styleConfig) return;
		//获取重点项目ID
		$.get(projectData.styleConfig).
		then(function(response) {
			majorProjectIds=response;
		var f = ol.format.ogc.filter;
		var featureRequest = new ol.format.WFS().writeGetFeature({
			srsName: 'EPSG:4326',
			featureNS: queryData.featureNS,
			featurePrefix: queryData.featurePrefix,
			featureTypes: queryData.layers,
			outputFormat: 'application/json',
			filter:GetProjectContial(projectData.typeValue)
		});
		fetch(queryData.url, {
			method: 'POST',
			body: new XMLSerializer().serializeToString(featureRequest)
		}).then(function(response) {
			return response.json();
		}).then(function(json) {
			var features = new ol.format.GeoJSON().readFeatures(json,{dataProjection: "EPSG:4326", featureProjection: "EPSG:3857"});
			if (features.length > 0) {
				var detailSource = new ol.source.Vector();
				var detailLayer = new ol.layer.Vector({
					source: detailSource,
					style: styleFunction
				});
				detailSource.addFeatures(features);
				//结果定位
				if(features.length>0){
					map.getView().fit(detailSource.getExtent(),map.getSize(),{padding: [170, 50, 30, 150]});
				}
				detailLayer.set("layerName","projectLayer");

				m_TempLayer = detailLayer;
				map.addLayer(detailLayer);
			}
		})
		});
	};
	//加载路况数据
	function GetroadCondition(projectData){
		//先请求路况数据
		var evaluationUrl=projectData.styleConfig+"year="+selectedYear+"&target="+selectSubitems[0]+"&type="+projectData.roadType;
		$.get(evaluationUrl).
		then(function(response) {
			evaluationdata = response;
			queryData = projectData.dataConfig
			var f = ol.format.ogc.filter;
			var featureRequest = new ol.format.WFS().writeGetFeature({
				srsName: 'EPSG:4326',
				featureNS: queryData.featureNS,
				featurePrefix: queryData.featurePrefix,
				featureTypes: queryData.layers,
				outputFormat: 'application/json',
				filter: GetRoadContial(projectData.typeValue)
			});
			fetch(queryData.url, {
				method: 'POST',
				body: new XMLSerializer().serializeToString(featureRequest)
			}).then(function (response) {
				return response.json();
			}).then(function (json) {
				var features = new ol.format.GeoJSON().readFeatures(json, {
					dataProjection: "EPSG:4326",
					featureProjection: "EPSG:3857"
				});
				if (features.length > 0) {
					var detailSource = new ol.source.Vector();
					var detailLayer = new ol.layer.Vector({
						source: detailSource,
						style: evaluationStyleFun
					});
					detailSource.addFeatures(features);
					//结果定位
					if (features.length > 0) {
						map.getView().fit(detailSource.getExtent(), map.getSize(), {padding: [170, 50, 30, 150]});
					}
					detailLayer.set("layerName","roadLayer")
					m_TempLayer = detailLayer;
					map.addLayer(detailLayer);
				}
			});
		});
		//加载符号
		var	lagendRenderdata=[];
		lagendRenderdata.push({
			color: 'green',
			text: "优"
		});
		lagendRenderdata.push({
			color: 'blue',
			text: "良"
		});
		lagendRenderdata.push({
			color: 'yellow',
			text: "中"
		});
		lagendRenderdata.push({
			color: 'red',
			text: "差"
		});
		Message_bone.trigger("legendShow", [lagendRenderdata]);
	};
	//加载养护标段
	function GetBdMap(){
		var source = new ol.source.TileWMS({
			url: queryConfig.queryBiaoDuan.url,
			params: {
				LAYERS:  queryConfig.queryBiaoDuan.layers,
				STYLES: '',
				format: 'image/png',
				tiled: true,
				transparent: true,
				VERSION: "1.1.1",
				SRS: "EPSG:900913"
			},
			crossOrigin:"anonymous"
		});
		var layer = new ol.layer.Tile({
			source: source
		});
		tempLayer = layer;
		map.addLayer(layer);
	};
	//获取项目加载条件
	function GetProjectContial(projecttype){
		var retunFun;
		//区域
		if(selectedRegion.length>1)
		{
			for(var i=0;i<selectedRegion.length;i++){
				if(i==0) {
					retunFun = ol.format.ogc.filter.or(ol.format.ogc.filter.equalTo("regioncode", selectedRegion[i]), ol.format.ogc.filter.equalTo("regioncode", selectedRegion[i + 1]));
				}
				else { retunFun=ol.format.ogc.filter.or(retunFun,ol.format.ogc.filter.equalTo("regioncode", selectedRegion[i]));}
			}
		}
		else{
			retunFun=ol.format.ogc.filter.equalTo("regioncode",selectedRegion[0]);
		}
		//年份
		if(selectedYear)
		{
			if(retunFun){
				retunFun=ol.format.ogc.filter.and(retunFun,ol.format.ogc.filter.equalTo("projectyear",selectedYear))
			}
			else{
				retunFun=ol.format.ogc.filter.equalTo("projectyear",selectedYear);
			}
		}
		//选择的项目类型
		if(retunFun){
			retunFun=ol.format.ogc.filter.and(retunFun,ol.format.ogc.filter.equalTo("projecttype",projecttype))
		}
		//项目子项
		if(selectSubitems.length>0){

			if(selectSubitems.length==1)
			{
				retunFun=ol.format.ogc.filter.and(retunFun,ol.format.ogc.filter.equalTo("projectclass", selectSubitems[0]));
			}
			else {
				var tempFun;
				for (var j = 0; j < selectSubitems.length; j++) {
					if (j == 0) {
						tempFun = ol.format.ogc.filter.or(ol.format.ogc.filter.equalTo("projectclass", selectSubitems[j]), ol.format.ogc.filter.equalTo("projectclass", selectSubitems[j + 1]));
					}
					else {
						 tempFun = ol.format.ogc.filter.or(tempFun, ol.format.ogc.filter.equalTo("projectclass", selectSubitems[j]));
					}
				}
			retunFun=ol.format.ogc.filter.and(retunFun,tempFun);
			}
		}
		return retunFun;
	};
	function GetRoadContial(projecttype){
		var retunFun;
		//道路类型
		//市政道路
		if(selectedszRoadtype.length>1)
		{
			for(var i=0;i<selectedszRoadtype.length;i++){
				if(i==0) {
					retunFun = ol.format.ogc.filter.or(ol.format.ogc.filter.equalTo("class", selectedszRoadtype[i]), ol.format.ogc.filter.equalTo("class", selectedszRoadtype[i + 1]));
				}
				else { retunFun=ol.format.ogc.filter.or(retunFun,ol.format.ogc.filter.equalTo("class", selectedszRoadtype[i]));}
			}
		}
		else if(selectedszRoadtype.length==1){
			retunFun=ol.format.ogc.filter.equalTo("class",selectedszRoadtype[0]);
		};
		//公路
		if(selectedglRoadtype.length>1)
		{
			for(var i=0;i<selectedglRoadtype.length;i++){
				if(i==0) {
					retunFun = ol.format.ogc.filter.or(ol.format.ogc.filter.equalTo("class", selectedglRoadtype[i]), ol.format.ogc.filter.equalTo("class", selectedglRoadtype[i + 1]));
				}
				else { retunFun=ol.format.ogc.filter.or(retunFun,ol.format.ogc.filter.equalTo("class", selectedglRoadtype[i]));}
			}
		}
		else if(selectedglRoadtype.length==1){
			retunFun=ol.format.ogc.filter.equalTo("class",selectedglRoadtype[0]);
		};

		if(selectedRegion.length>0) {
			if(selectedRegion==1)
			{
				retunFun=ol.format.ogc.filter.and(retunFun,ol.format.ogc.filter.equalTo("quname", selectedRegion[i]));
			}
			else {
				var tempContionl;
				for (var i = 0; i < selectedRegion.length; i++) {
					if (i == 0) {
						tempContionl = ol.format.ogc.filter.or(ol.format.ogc.filter.equalTo("quname", selectedRegion[i]), ol.format.ogc.filter.equalTo("quname", selectedRegion[i+1]));
					}
					else {
						tempContionl = ol.format.ogc.filter.or(tempContionl, ol.format.ogc.filter.equalTo("quname", selectedRegion[i]));
					}
				}
				retunFun=ol.format.ogc.filter.and(retunFun,tempContionl);
			}
		}
		return retunFun;
	}
	//点击查询事件
	function queryFun(e) {
		var pixel = map.getEventPixel(e.originalEvent);
		var featureInfo = map.forEachFeatureAtPixel(pixel,
			function (feature, layer) {
				return {feature:feature,layer:layer};
			});
		if (featureInfo!==undefined&&featureInfo!==null
			&&featureInfo.layer!==null)
		{
			var overlay = new ol.Overlay({
				element: document.getElementById("overlay"),
				positioning: "bottom-center"
			});
			map.addOverlay(overlay);
			var element = overlay.getElement();
			$(element).addClass("detail");
			$(element).find(".ocontent").empty();
			if(featureInfo.feature.getKeys().indexOf("projectname")>0) {
				$(element).find(".ohead p").html(featureInfo.feature.getProperties()["projectname"]);
				var Featureproperties=featureInfo.feature.getProperties();
				var fprojectType=Featureproperties["projecttype"];
				//获取项目详情信息并展示
				var InfoUrl=porjectConfig.projectInfo.detailUrl;
				InfoUrl+="id="+Featureproperties["projectid"]+"&projecttype="+fprojectType;
				$.get(InfoUrl).then(function (response) {
					if(response){
						for(var key in response) {
							var  titleStr=Pengtu.buildCodeName("7778", key);
							if(titleStr!=key) {
								$("<p>").text(titleStr + ": " + response[key]).appendTo($(element).find(".ocontent"));
							}
						}
					}
					$("<p>").text("项目详情: ").append($("<a>").text("查看详情").attr({
						"href": porjectConfig[fprojectType].detailUrl + featureInfo.feature.getProperties()["projectid"],
						"target": "_blank"
					})).appendTo($(element).find(".ocontent"));
					});
			}
			else if(featureInfo.feature.getKeys().indexOf("name")>0){
				if(featureInfo.feature.getKeys().indexOf("data-score")>0)
				{
					$("<p>").text("等级评分" + ": " +featureInfo.feature.getProperties()["data-score"]).appendTo($(element).find(".ocontent"));
				}
				//加载路面类型和道路
				$("<p>").text("道路起点" + ": " +featureInfo.feature.getProperties()["start"]).appendTo($(element).find(".ocontent"));
				$("<p>").text("道路终点" + ": " +featureInfo.feature.getProperties()["end_"]).appendTo($(element).find(".ocontent"));
				$("<p>").text("路面类型" + ": " +featureInfo.feature.getProperties()["rode_type"]).appendTo($(element).find(".ocontent"));
				$(element).find(".ohead p").html(featureInfo.feature.getProperties()["name"]);
				$("<p>").text("道路全生命周期:").append($("<a>").text("查看详情").attr({
					"href": "/ssjc/gis/lifecycle.jsp?roadname=" +featureInfo.feature.getProperties()["name"]+"&district="+featureInfo.feature.getProperties()["quname"]+"&roadCode="+featureInfo.feature.getProperties()["hb_code"],
					"target": "_blank"
				})).appendTo($(element).find(".ocontent"));
			}
			else{
				$(element).find(".ohead p").html(featureInfo.feature.getId());
			}
			$(element).data("query", overlay);
			overlay.setPosition(e.coordinate);
		}
		else
		{
			var olay = $("#overlay").data("query");
			olay && olay.setPosition([9999, 9999]);
		}
	};
	//加载统计图
	function AddStaticMap(projectData){
		Message_bone.trigger("infoStart");
		Message_bone.trigger("loading");
		var overlays = [];
		url = projectData.dataconfig.url;
		if(selectedStaticType=="市政道路评价指标"||selectedStaticType=="公路评价指标")
		{
			url += "&target=" + selectedSubitemType;
		}
		if(mapp[selectedSubitemType]) {
			url += "fromParam=" + mapp[selectedSubitemType];
		}
		if(projectData.valueType) {
			url += "&type=" + projectData.valueType;
		}
		$.get(url).then(function (response) {
			var color= projectData.colors;
			var length = response.length;
		    var	lagendRenderdata=[];
			var overlay;
			if (!length) {
				Message_bone.trigger("infoEnd");
				model.buttonStat = {
					"klass": "confirm",
					"text": "查看"
				};
				Message_bone.trigger("removeLayer");
			}
			for (var i = 0; i < length; i += 1) {
				overlay = new ol.Overlay({
					element: $('<div class="popupoverlay" style="width: 150px; height: 150px">')[0],
					positioning: "center-center",
					stopEvent: false
				});
				var datas = [],
					rdata = response[i].data,
					len = rdata.length;
				for (var j = 0; j < len; j += 1) {
					datas.push({
						value: rdata[j],
						name: response[i].legend[j]
					});
				}
				var div = overlay.getElement();
				//用echarts生成统计图
				if (projectData.showToolTip) {
					var myChart = echarts.init(div);
					var Chartunit;
					if (response[i].subtitle == "百分比") {
						Chartunit = "%";
					} else if (response[i].subtitle == "数值") {
						Chartunit = "";
					}
					else {
						Chartunit = response[i].subtitle;
					}
					var centerName = response[i].density ? response[i].density + '\n' + response[i].name : response[i].name;
					if (!projectData.showToolTip) {
						option = {
							color: color,
							series: [
								{
									name: response[i].legend[0].indexOf("密度") > 0 ? centerName + '\n' + Chartunit : centerName + '\n' + response[i].legend[0] + '\n' + response[i].data[0] + Chartunit,
									type: "pie",
									radius: ['50%', '70%'],
									center: ['50%', '50%'],
									data: datas,
									avoidLabelOverlap: false,
									label: {
										normal: {
											show: true,
											position: 'center',
											formatter: "{a}",
											textStyle: {
												fontSize: '15',
												fontWeight: 'bold',
												color: "#3E4058"
											}
										}
									},
									labelLine: {
										normal: {
											show: false
										}
									}
								}
							]
						};
					} else {
						option = {
							tooltip: {
								trigger: 'item',
								formatter: "{b}: {c} " + Chartunit + "({d}%)",
								show: projectData.showToolTip
							},
							color: color,
							series: [
								{
									name: centerName,
									type: "pie",
									radius: ['50%', '70%'],
									center: ['50%', '50%'],
									data: datas,
									avoidLabelOverlap: false,
									label: {
										normal: {
											show: true,
											position: 'center',
											formatter: "{a}",
											textStyle: {
												fontSize: '15',
												fontWeight: 'bold',
												color: "#3E4058"
											}
										},
										emphasis: {
											show: true,
											textStyle: {
												fontSize: '15',
												fontWeight: 'bold',
												color: "#3E4058"
											}
										}
									},
									labelLine: {
										normal: {
											show: false
										}
									}
								}
							]
						};
					}
					myChart.setOption(option);
				}
				//简单的Mark
				else {

					var idenHtml = identification(isNaN(rdata[0])?rdata[0].toFixed(2):parseFloat(rdata[0]).toFixed(2), response[i].name);
					$(div).append(idenHtml);
				}
				$(div).on("mousedown", "canvas", function (e) {
					var view = map.getView();
					var xy = map.getCoordinateFromPixel([e.clientX, e.clientY]);
					$(document).on("mousemove", function (e) {
						var newPoint = map.getCoordinateFromPixel([e.clientX, e.clientY]);
						var coorsub = [(newPoint[0] - xy[0]) / 10, (newPoint[1] - xy[1]) / 10];
						var center = view.getCenter();
						newCenter = [center[0] - coorsub[0], center[1] - coorsub[1]];
						view.setCenter(newCenter);
					});
					$(document).on("mouseup", function (e) {
						$(this).off("mousemove");
					});
				});
				$(div).on("mousewheel", "canvas", function (e) {
					var view = map.getView();
					var scroll = e.originalEvent.wheelDelta ?
						e.originalEvent.wheelDelta > 0 ? 1 : -1
						: e.originalEvent.detail > 0 ? -1 : 1;
					var zoom = ol.animation.zoom({
						resolution: view.getResolution(),
						duration: 400
					});
					map.beforeRender(zoom);
					view.setZoom(view.getZoom() + scroll);

				});

				overlay.setPosition(ol.proj.transform(districkcentre[response[i].code], 'EPSG:4326', 'EPSG:3857'));
				if (!projectData.showToolTip){
					overlay.setOffset([-80,-80]);
				}
				overlays.push(overlay);
				map.addOverlay(overlay);
			};
			m_StaticLayers=overlays;
			var zoom = ol.animation.zoom({
				resolution: map.getView().getResolution(),
				duration: 400
			});
			if(projectData.showLegend) {
				for (var j = 0; j <  response[0].legend.length; j +=1) {
					lagendRenderdata.push({
						color: projectData.colors[j],
						text: response[0].legend[j]
					});
				};
				Message_bone.trigger("legendShow", [lagendRenderdata]);
			}
			else {
				Message_bone.trigger("legendHide");
			}
			map.beforeRender(zoom);
			map.getView().setZoom(11);
			//map.getLayers().getArray()[0].setOpacity("0.7");
			Message_bone.trigger("infoEnd");
			Message_bone.trigger("loaded");
		});
	};
	//定位标识图标
	function identification(num,name){
		var html = 
					'<div class="ident">'
					+'	<div class="num">'+num+'</div>'
					+'	<div class="name">'+name+'</div>'
					+'</div>';
		return html;
	}
	Array.prototype.RemoveValue=function(value){
		for(var i=0; i<this.length; i++) {
			if(this[i] == value) {
				this.splice(i, 1);
				break;
			}
		}
	};

	var thematic = new thematic ("#thematicMap");
});